package com.tencent.iov.cowin.befsale.clue.repository.cus.impl;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.dao.cus.CustomerBehaviorDao;
import com.tencent.iov.cowin.befsale.clue.domain.cus.po.CustomerBehavior;
import com.tencent.iov.cowin.befsale.clue.repository.cus.CustomerBehaviorManager;
import com.tencent.iov.cowin.befsale.clue.value.contants.ServiceConstant;
import com.software.boot.dao.annotation.TargetDataSource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * @Describe: 客户行为标签统计表（线索中心需求建表）_Manager实现层
 * @author: xiamu
 * @created: 2022-01-11 16:00:51
 * @version: 1.0
 */
@Service
public class CustomerBehaviorManagerImpl implements CustomerBehaviorManager {

    @Autowired
    private CustomerBehaviorDao customerBehaviorDao;

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public CustomerBehavior getDetailById(Long id) {
        return customerBehaviorDao.getDetailById(id);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int insert(CustomerBehavior request) {
        return customerBehaviorDao.insert(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int insertBatch(List<CustomerBehavior> requests) {
        return customerBehaviorDao.insertBatch(requests);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int update(CustomerBehavior request) {
        return customerBehaviorDao.update(request);
    }

    @Override
    public int delete(Integer id) {
        return customerBehaviorDao.delete(id);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public List<CustomerBehavior> getListByParam(CustomerBehavior request) {
        return customerBehaviorDao.getListByParam(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public Page<CustomerBehavior> getPageByParam(CustomerBehavior request, RowBounds rowBounds) {
        return customerBehaviorDao.getPageByParam(request, rowBounds);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public CustomerBehavior getOneByParam(CustomerBehavior request) {
        return customerBehaviorDao.getOneByParam(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public List<CustomerBehavior> statisticalByCusType(Integer cusType) {
        return customerBehaviorDao.statisticalByCusType(cusType);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_READ)
    public CustomerBehavior statisticalByCusId(CustomerBehavior request) {
        return customerBehaviorDao.statisticalByCusId(request);
    }

    @Override
    @TargetDataSource(ServiceConstant.QW_SALE_WRITE)
    public int deleteByDay(Date day) {
        return customerBehaviorDao.deleteByDay(day);
    }
}
